home *** CD-ROM | disk | FTP | other *** search
/ Toolkit for Nursing Excel…t End of Life Transition / Toolkit for Nursing Excellence at End of Life Transition.iso / InstallTneel.hta < prev    next >
Text File  |  2001-11-01  |  6KB  |  154 lines

  1. <HTA:APPLICATION ICON=tneelne.ico
  2. APPLICATIONNAME = "tneel-ne"
  3. WINDOWSTATE = "maximize"
  4. BORDERSTYLE = "complex"
  5. SINGLEINSTANCE = "yes"
  6. NAVIGABLE = "yes">
  7. <head>
  8. <title>TNEEL Installation</title>
  9. <HTA:APPLICATION >
  10. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  11. <link rel="stylesheet" href="ne_style.css">
  12. <style type="text/css">
  13. <!--
  14. A:hover { color: #CC3300; text-decoration: underline}
  15. .evalink {  font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #003399; text-decoration: underline}
  16. .words {  font-family: Arial, Helvetica, sans-serif; font-size: 14pt; font-weight: normal; color: #000000}
  17. -->
  18. </style>
  19.  
  20. <SCRIPT LANGUAGE="vbscript">
  21.  
  22. dim messageWindow
  23.  
  24. function InstallFiles()
  25.     
  26.     dim fso, fld, fil
  27.     dim validDrive
  28.     dim TargetPath
  29.     dim SourcePath
  30.     dim FileToBeCopied
  31.     dim FileDest
  32.  
  33.     set messageWindow = window.showModelessDialog("copying.htm","","dialogHeight: 100px; dialogWidth: 300px; center: Yes; help: No; resizable: No; status: No; scroll: No;")
  34.     validDrive=window.document.location
  35.     set fso=CreateObject("Scripting.FileSystemObject")
  36.     validdrive=replace(validdrive, "file:///", "")
  37.     validDrive = replace(validDrive, "%20", " ")
  38.     validDrive = replace(validDrive, "%23", "#")
  39.     validDrive = replace(validDrive, "%25", "%")
  40.     validDrive = replace(validDrive, "%7b", "{")
  41.     validDrive = replace(validDrive, "%7d", "}")
  42.     validDrive = replace(validDrive, "%5e", "^")
  43.     validDrive = replace(validDrive, "%7e", "~")
  44.     validDrive = replace(validDrive, "%5b", "[")
  45.     validDrive = replace(validDrive, "%5d", "]")
  46.     validDrive = replace(validDrive, "%60", "'")
  47.     validDrive = replace(validDrive, "%26", "&")    
  48.     validdrive=left(validDrive,len(validdrive)-16)
  49.     sourcepath=validDrive
  50. ' create the folder, c:\program files\Tneel.
  51. ' Checking if the folder exists first.  If it does, skip the following 
  52. ' folder building codes
  53.     if fso.folderexists ("c:\program files\Tneel") = true then
  54.         fso.deletefolder ("c:\program files\Tneel"), true
  55.     end if
  56.     fso.createfolder ("c:\program files\Tneel")
  57.     TargetPath = "c:\program files\Tneel\"
  58.  
  59. ' Copy root files
  60.     for each fil in fso.getfolder(validdrive).files
  61.         if fil.name<>"InstallTneel.hta" and fil.name<>"message.htm" then
  62.             FileToBeCopied = SourcePath & fil.name
  63.             FileDest = TargetPath & fil.name
  64.             fso.copyfile FileToBeCopied, FileDest
  65.         end if
  66.     next
  67. dim subFld
  68. dim FolderToBeCopied
  69. dim TargetFolderName
  70.  
  71. ' Create and Copy folders and subfolders
  72.     set fld = fso.GetFolder (validDrive)
  73.     for each subfld in fld.subfolders
  74.         FolderToBeCopied = ValidDrive & subfld.name
  75.         TargetFolderName = TargetPath & subfld.name
  76.         fso.copyfolder foldertobecopied, targetfoldername
  77.     next    
  78.     
  79.     createShortcut()                
  80.     window.close       
  81. end function
  82.  
  83.  
  84. function createShortcut()
  85. 'if it already exists it will be re-written 
  86.     on error resume next                 
  87.  
  88.     dim WshShell
  89.     dim oShellLink
  90.     dim DesktopPath
  91.     dim MyDocsPath
  92.     dim fso
  93.     dim file1
  94.     dim fileSource, fileDest
  95.     dim iconMessage    
  96.  
  97.     messageWindow.close()
  98.     set iconMessage = window.showModalDialog("message.htm","","dialogHeight: 150px; dialogWidth: 600px; center: Yes; help: No; resizable: No; status: No; scroll: No;")     
  99.              
  100.     Set WshShell = CreateObject("WScript.Shell")
  101.     
  102.     ' make sure that mplayer2 is registered to play .mp3 files.
  103.                                    
  104.     tempvar = WSHShell.RegRead ("HKEY_USERS\.DEFAULT\Software\Microsoft\MediaPlayer\Setup\CreatedLinks\AppName")                                
  105.     
  106.     if tempvar = "" then
  107.         WSHShell.RegWrite "HKEY_USERS\.DEFAULT\Software\Microsoft\MediaPlayer\Setup\CreatedLinks\AppName", "C:\Program Files\Windows Media Player\mplayer2.exe"
  108.         tempvar = "C:\Program Files\Windows Media Player\mplayer2.exe"                                
  109.     end if
  110.     
  111.     WSHShell.RegWrite "HKCR\.mp3\", "mp3file"
  112.     WSHShell.RegWrite "HKCR\.mp3\Content Type\", "audio/mpeg"
  113.     WSHShell.RegWrite "HKCR\mp3file\shell\open\command\", """" + tempvar + """" + " /Open " + """" + "%L" + """"
  114.     WSHShell.RegWrite "HKCR\mp3file\shell\open\command\", """" + tempvar + """" + " /Play " + """" + "%L" + """"                       
  115.     
  116.     DesktopPath = WSHShell.SpecialFolders("Desktop")
  117.     Set oShellLink = WshShell.CreateShortcut(DesktopPath & "\tneel-ne.lnk")
  118.     oShellLink.TargetPath = "C:\Program Files\TNEEL\StartTneel.hta"    
  119.  
  120.     oShellLink.IconLocation = "C:\Program Files\TNEEL\tneelne.ico"            
  121.  
  122.     oShellLink.Save    
  123.  
  124. end function
  125.  
  126.  
  127. </script>
  128.  
  129. </head>
  130.  
  131. <body bgcolor="#7DB7B9" ondragstart="window.event.dataTransfer.effectAllowed = 'none'" onLoad="" link="#003399" alink="#CC3300">
  132. <span class="evalink"></span> 
  133. <div id="title" style="position:absolute; width:52px; height:115px; z-index:2; top: 62px; left: 36px"><img src="images/title.gif" width="49" height="367">
  134. </div>
  135. <div id="Layer3" style="position:absolute; width:732px; height:39px; z-index:6; left: 12px; top: 10px"><img src="images/threadbar.gif" width="100" height="39"><img src="images/emptybar.gif" width="605" height="39"><img src="images/endbar.gif" width="23" height="39"></div>
  136. <div id="Layer2" style="position:absolute; width:645px; height:328px; z-index:2; top: 78px; left: 100px"> 
  137.  
  138.   <H1><p align="center">TNEEL Installation</p></H1>
  139.   <p></p>
  140.   <p>Click the button below to install TNEEL on your computer. <br>
  141.     The TNEEL files will be installed into the folder C:\Program Files\TNEEL. 
  142.     <br>
  143.   </p>
  144.   <p>The installation will take 10-15 minutes.</p> 
  145.     <p> </p>
  146. <form name="form1">
  147. <p align="center"><input type=button value="Install TNEEL" name="button1" onClick="InstallFiles()"></p>
  148.  
  149. </form> 
  150.  </div>
  151.  
  152. </body>
  153.  
  154.